package day03;

import java.util.Arrays;

public class MaxOfArrayDemo {
    public static void main(String[] args) {
        int[] arr ={50,20,90,70,10};
        int max =arr[0];
        for (int i=1;i< arr.length;i++){
            if (max<arr[i]){
                max=arr[i];
            }
        }
        arr= Arrays.copyOf(arr,arr.length+1);
        arr[arr.length-1]=max;
        System.out.println(Arrays.toString(arr));

    }
}
